class Train < ActiveRecord::Base
  has_many :daily
  has_many :train_task
  has_many :routers , :through => :train_router

  def self.findPage offset,limit
    find(:all,:offset => offset,:limit => limit)
  end

  #已经锁定的记录，不进行选择。
  def self.findBySn sn
    find(:all,:conditions=>['is_locked = 0 AND sn like ?','%'+sn+'%'])
  end
  
end
